﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ElectronicsMarket_Desktop.EMServices;

namespace ElectronicsMarket_Desktop.BL
{
  public  class StaffBL
    {
        STAFF staff = new STAFF();
        ServicesReleaseSoapClient services;

        public STAFF Staff
        {
            get { return staff; }
            set { staff = value; }
        }

        public StaffBL()
        {
            services = new ServicesReleaseSoapClient();
        }
      public bool KiemTra()
      {

          staff = services.getStaffByName(staff.STAFF_SYS_NAME, staff.STAFF_PASSWORD);
           if (staff != null)
               return true;
           else
               return false;
          
      }
      public List<STAFF> getAllStaff()
      {
          List<STAFF> lststaff = new List<STAFF>();
          lststaff = services.getAllStaff().ToList();
          return lststaff;
      }
      public void insertStaff()
      {
          services.insertStaff(Staff);
      }
      public void updateStaff()
      {
          services.updateStaff(Staff);
      }
      public void deleteStaff()
      {
          services.deleteStaff(Staff);
      }
      public long getLastStaffId()
      {
          return services.getLastStaffId();
      }
    }
}
